package com.hzj.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hzj.mapper.PaymentInfoMapper;
import com.hzj.pojo.PaymentInfo;
import com.hzj.service.PaymentInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class PaymentInfoServiceImpl extends ServiceImpl<PaymentInfoMapper, PaymentInfo> implements PaymentInfoService {

   @Autowired
   private  PaymentInfoMapper pm;

    @Override
    public boolean updatePaymentInfo(PaymentInfo paymentInfo) {
        QueryWrapper wrapper=new QueryWrapper();
        wrapper.eq("out_trade_no",paymentInfo.getOutTradeNo());
        return saveOrUpdate(paymentInfo,wrapper);
    }

    @Override
    public int selectCount() {
        return pm.selectCount();
    }
}
